﻿/*jslint bitwise: true, browser: true, eqeqeq: true, immed: true, newcap: true, nomen: true, onevar: true, plusplus: true, regexp: true, undef: true, white: true, indent: 4*/

var analogue = (function () {
    var build = new Date('%%%BUILDDATE%%%'), versioning = [1, build.getFullYear().toString().slice(2), build.getMonth().toString()];
    return {
        bind: function (object, method) {
            if (!method) {
                method = this;
            }
            return function () {
                return method.apply(object, arguments);
            };
        },
        extend: function (object, source) {
            if (!source) {
                source = object;
                object = this;
            }
            for (var i in source) {
                if (source.hasOwnProperty(i) && !object[i]) {
                    object[i] = source[i];
                }
            }
            return object;
        },
        path: document.getElementsByTagName('script')[0].src.replace(/js$/, '').replace(new RegExp('^' + document.location.protocol + '//' + document.domain), ''),
        version: versioning.join('.') + ' (' + build.valueOf() + ')'
    };
}());